﻿using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;

public partial class admin_buscador : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = null;
        if (Session["userid"] == null) Response.Redirect("../default.aspx");
        if (!Page.IsPostBack)
        {
            int tosimple= DB.getCountbyDay("SINGLE");
            int todouble = DB.getCountbyDay("DOUBLE");
            int wesimple = DB.getCountbyWeek("SINGLE");
            int wedouble = DB.getCountbyWeek("DOUBLE");
            int tototal = tosimple + (todouble * 2);
            int wetotal = wesimple + (wedouble * 2);
            int simpletotal = DB.getTotalApproved("SINGLE");
            int doubletotal = DB.getTotalApproved("DOUBLE");
            int grandtotal = simpletotal + (doubletotal*2);

            lb_tosimple.Text = tosimple.ToString();
            lb_todouble.Text = todouble.ToString();
            lb_wesimple.Text = wesimple.ToString();
            lb_wedouble.Text = wedouble.ToString();
            lb_tototal.Text = tototal.ToString();
            lb_wetotal.Text = wetotal.ToString();
            lb_simpletotal.Text = simpletotal.ToString();
            lb_dobletotal.Text = doubletotal.ToString();
            grantotal.Text = grandtotal.ToString();
        }
        
    }
    
    protected void bt_search_Click(object sender, EventArgs e)
    {
        string where = "dat_id>0";
       
        string ruta = "c:\\TEMP\\archivo.txt";
        StreamWriter escritor = new StreamWriter(ruta, true);
        escritor.WriteLine(where);
        escritor.Close();
        //DataSet ds = (DataSet)DB.getData(where);
        //Session["where"] = ds;
        //gvd.DataSource = ds;
        //gvd.DataBind();
    }
}
